﻿using System.Collections.Generic;
using Wintellect.PowerCollections;

namespace GenericClass
{
    class PriorityQueue<T> where T: IEnumerable<T>
    {
        private OrderedBag<T> priorityQueue;

        public void Enqueue(T item)
        {
            priorityQueue.Add(item);
        }

        public T Dequeue()
        {
            T item = priorityQueue[0];
            priorityQueue.RemoveFirst();
            return item;
        }

        public T this[int index]
        {
            get
            {
                T item = priorityQueue[index];
                return item;
            }
        }
    }
}